import logging

class Actionizer:
  def __init__(self, putAction, deleteAction):
    self.putAction = putAction
    self.deleteAction = deleteAction

  def actionize(self, model):
    actions = []
    
    #for model in models:
    actions.append(self.createActionTuple(model, self.putAction))
    actions.append(self.createActionTuple(model, self.deleteAction))
    
    logging.debug(str(actions))
    
    return actions

  def createActionTuple(self, model, actionHandler):
    action = '/' + model.__name__.lower() + '/' + actionHandler.actionURL
      
    return (action, lambda: actionHandler(model))
